package com.aizhixin.lab.docker.service;

import com.aizhixin.lab.docker.entity.ContainerToImages;
import com.aizhixin.lab.docker.entity.LastOperation;
import com.aizhixin.lab.docker.repository.LastOperationRepository;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class LastOperationService {
    @Autowired
    private LastOperationRepository lastOperationRepository;

    public void deleteByCourseIdAndUserId(String courseId,Long userId){
        lastOperationRepository.deleteByCourseIdAndUserId(courseId,userId);
    }
    public void save(LastOperation lastOperation){
        lastOperationRepository.save(lastOperation);
    }
    public void save(List<LastOperation> lastOperations){
        lastOperationRepository.save(lastOperations);
    }
}
